package com.ganwei.mybatisplus.system.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ganwei.mybatisplus.config.util.ResultVo;
import com.ganwei.mybatisplus.system.pojo.Role;
import com.ganwei.mybatisplus.system.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ganwei
 * @since 2020-11-09
 */
@RestController
@RequestMapping("/roles")
public class RoleController {

    @Autowired
    private IRoleService iRoleService;

    @RequestMapping("/role")
    public ResultVo roleAll(){
        QueryWrapper<Role> wrapper = new QueryWrapper<>();
        //notLike 不包含该字段
        Page<Role> page = new Page<>(0, 10);
        IPage<Role> roleIPage = iRoleService.selectPage(page, wrapper);
        return ResultVo.success(200,"查询成功",roleIPage);
    }

}

